import { nextTick } from 'vue';
export const focus = {
  mounted: (el, { value }) => {
    if (value) {
      const { 是focus否, select } = value;
      nextTick(() => {
        if (是focus否) {
          el.focus();
        }
        if (select) {
          el.select();
        }
      });
    }
  },
  updated: (el, { value }) => {
    if (value) {
      const { 是focus否 } = value;
      if (是focus否) {
        el.focus();
      }
    }
  }
};

export default focus
